class Solution {
public:
    void Insert(int num)
    {
        v.push_back(num);
    }

    double GetMedian()
    { 
    	sort(v.begin(),v.end());
    	if(v.size() % 2 ==0)
    		return (v[v.size()/2] + v[v.size()/2-1])/2.0;
    	else
    		return v[v.size()/2];
    }
private:
	vector<int> v;
};